<template>
	<Status :status="1" :zoom="0.7" :txt="info.FDocumentStatus"></Status>
	<view class="line-title">{{info.FBillNo}}</view>
	<view class="line xl">
		<view class="line-label">养殖批次：</view>
		<view class="line-content">{{info['F_QUQY_BreedingContract.FName']}}</view>
	</view>
	<view class="line xl">
		<view class="line-label">客户：</view>
		<view class="line-content">{{info['F_QUQY_Customer.FName']}}</view>
	</view>
	<view class="line">
		<view class="line-label">申请日期：</view>
		<view class="line-content">{{moment(info.F_QUQY_Date).format('YYYY-MM-DD')}}</view>
	</view>
	<view class="line">
		<view class="line-label">是否退药：</view>
		<view class="line-content">{{Number(info.F_QUQY_DrugRepercussion)?'是':'否'}}</view>
	</view>
	<view class="btns noborder">
		<van-tag type="primary" size="large" @click.stop="emit('submit', info)" v-if="(info.FDocumentStatus=='A'||info.FDocumentStatus=='D') && myInfo.role.includes(5) && info.F_QUQY_CreatorId==myInfo.UserId">提 交</van-tag>
		<van-tag type="primary" size="large" @click.stop="edit" v-if="(info.FDocumentStatus=='A'||info.FDocumentStatus=='D') && myInfo.role.includes(5) && info.F_QUQY_CreatorId==myInfo.UserId">编 辑</van-tag>
		<van-tag type="danger" size="large" @click.stop="emit('remove', info)" v-if="(info.FDocumentStatus=='A'||info.FDocumentStatus=='D') && myInfo.role.includes(5) && info.F_QUQY_CreatorId==myInfo.UserId">删 除</van-tag>
		<van-tag type="primary" size="large" @click.stop="emit('audit', info)" v-if="info.FDocumentStatus=='B' && myInfo.role==7">审 核</van-tag>
		<van-tag type="primary" size="large" @click.stop="emit('unAudit', info)" v-if="info.FDocumentStatus=='C' && myInfo.role==7">反审核</van-tag>
	</view>
</template>

<script setup>
	// 上苗计划列表
	import moment from 'moment'
	import { reactive, getCurrentInstance, ref } from 'vue'
	import { onLoad } from '@dcloudio/uni-app'
	const { proxy } = getCurrentInstance()

	const props = defineProps({
		info: {
			type: Object,
			default: () => {}
		},
		myInfo: {
			type: Object
		}
	})

	const state = reactive({})

	const emit = defineEmits(['remove', 'audit', 'unAudit', 'submit', 'reAudit'])

	const edit = () => {
		uni.navigateTo({
			url: `/views/module/forms/VeterinaryDrugApplication?Id=${props.info.FID}`
		})
	}
</script>
<style lang="scss" scoped>
	.line-title {
		width: 100%;
		font-weight: 800;
		line-height: 60rpx;
		color: #409eff;
	}

	.line {
		display: flex;
		width: 50%;
		line-height: 50rpx;

		&.xl {
			width: 100%;
		}

		.line-label {
			width: 140rpx;
			text-align: justify;
			text-align-last: justify;
		}
	}

	.van-tag {
		margin-right: 20rpx;
	}
</style>